package student.view.MainViewTable;

import javax.swing.table.DefaultTableModel;
import java.util.Vector;

public class MainViewTableModel extends DefaultTableModel {
    static Vector<String> colums=new Vector<>();
    static {
        colums.addElement("编号");
        colums.addElement("姓名");
        colums.addElement("性别");
        colums.addElement("出生日期");
        colums.addElement("语文");
        colums.addElement("数学");
        colums.addElement("英语");
        colums.addElement("总成绩");
        colums.addElement("平均成绩");
    }
    private MainViewTableModel(){
        super(null,colums);
    }
    private static MainViewTableModel mainViewTableModel=new MainViewTableModel();
    public static MainViewTableModel assembleModel(Vector<Vector<Object>>data){
        mainViewTableModel.setDataVector(data,colums);
        return mainViewTableModel;
    }
    public static Vector<String>getColums(){
        return colums;
    }
    public boolean isCellEditable(int row,int colum){
        return false;
    }
}
